package com.wwz.activiti;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Deployment;

/**
 * <p>Description:流程定义部署</p >
 * <p>Copyright: Copyright (c)2021</p >
 * <p>Company: Xueqiu</p >
 * <P>Created Date :2021-04-05</P>
 * <P>@version 1.0</P>
 */
public class ActivitiDeployment {
    public static void main(String[] args) {
        //1、创建processEngine
        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
        //2、得到RepositoryService实例
        RepositoryService repositoryService = processEngine.getRepositoryService();
        //3、进行部署
        Deployment deployment = repositoryService.createDeployment()
                .addClasspathResource("diagram/holiday.bpmn")//添加资源
                .addClasspathResource("diagram/holiday.png")
                .name("请假流程")
                .deploy();
        System.out.println(deployment.getName());
        System.out.println(deployment.getId());
    }

}
